package com.ulrica.morning.easyexcel;

import lombok.SneakyThrows;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;

/**
 * 导出文件
 *
 * @author LongKui
 * @since 2022/06/30
 */
public class WriteFile {

    public static void writeTxt(List<?> list, String filePath) {
        try(BufferedWriter writer = new BufferedWriter(new FileWriter(filePath))){
            for (Object t : list) {
                writer.write(t.toString());
                writer.write("\r\n");
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
